<template>
	<view class="sign">
		<view class="select">
			<uni-data-select v-model="value" :localdata="range" @change="change"></uni-data-select>
		</view>
		<view class="card" v-for="(item, index) in list" :key="index" @click="handleSituation">
			<view class="card_top">
				<view class="left">
					<img class="card_img" src="/static/time.png" alt="" />
					<view class="card_title">
						签到日期：{{ item.time }}
					</view>
				</view>
				<view class="right">
					累计签到：{{item.signedIn}}/{{item.amount}}
				</view>
			</view>
			<view class="card_content">
				<view class="pd">
					校内入住签到：{{ item.inSchool }}
				</view>
				<view class="pd">
					校外入住签到：{{ item.outSchool }}
				</view>
				<view class="pd">
					关联批次：{{ item.batch }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: 0,
				range: [
					{ value: 0, text: "近一个月" },
					{ value: 1, text: "近三个月" },
					{ value: 2, text: "近半年" },
					{ value: 2, text: "近一年" },
				],
				list: [
					{
						time: '2024/1/20',
						inSchool: '800',
						outSchool: '400',
						batch: '2023年春季放假',
						amount: '20',
						signedIn: '10'
					},{
						time: '2024/1/21',
						inSchool: '0',
						outSchool: '1200',
						batch: '2023年春季放假',
						amount: '20',
						signedIn: '11'
					},{
						time: '2024/1/22',
						inSchool: '900',
						outSchool: '10',
						batch: '2023年春季放假',
						amount: '20',
						signedIn: '12'
					},{
						time: '2024/1/23',
						inSchool: '200',
						outSchool: '130',
						batch: '2023年春季放假',
						amount: '20',
						signedIn: '13'
					},{
						time: '2024/1/24',
						inSchool: '300',
						outSchool: '85',
						batch: '2023年春季放假',
						amount: '20',
						signedIn: '14'
					},{
						time: '2024/1/25',
						inSchool: '100',
						outSchool: '56',
						batch: '2023年春季放假',
						amount: '20',
						signedIn: '15'
					},
				]
			}
		},
		methods: {
			change(e) {
				console.log("e:", e);
			},
			handleSituation() {
				uni.navigateTo({
					url: '/pages/situation/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.select{
		width: 94%;
		margin: 20rpx auto 0rpx;
		::v-deep .uni-select{
			width: 30%;
			padding: 0 30rpx;
			background-color: #fff;
			float: right;
			border-radius: 30rpx;
		}
	}
	.card{
		width: 88%;
		padding: 20rpx;
		margin: 20rpx auto;
		border-radius: 10rpx;
		background: #fff;
		.card_top{
			display: flex;
			justify-content: space-between;
			align-items: center;
			.left{
				display: flex;
				align-items: center;
				font-size: 28rpx;
				padding: 10rpx 0rpx;
				.card_img{
					width: 40rpx;
					height: 40rpx;
					margin-right: 16rpx;
				}
			}
			.right{
				color: #686868;
				font-size: 24rpx;
			}
		}
	}
	.card_content{
		font-size: 24rpx;
		padding: 20rpx 0rpx;
		color: #5D5E5D;
		.pd{
			padding: 4rpx 0rpx;
		}
	}
</style>